﻿Public Class ObraDAL
    Private db As DataClasses1DataContext
    Sub New()
        Try
            db = New DataClasses1DataContext(sqlConfiguracon.GetConnectionString)
        Catch ex As Exception

        End Try
    End Sub
    Sub agregarNuevoTipoDeHerramienta(tipoDeHerramienta As String, cantidad As Integer)
        Try
            Dim q = (From x In db.Stock Where x.TipoHerramienta = tipoDeHerramienta).FirstOrDefault
            If IsNothing(q) Then
                Dim s As New Stock
                s.CantidadTotal = cantidad
                s.TipoHerramienta = tipoDeHerramienta
                db.Stock.InsertOnSubmit(s)
            End If
        Catch ex As Exception

        End Try
    End Sub
End Class
